package com.navigationtest;

import com.myatest.R;
import com.pbase.ui.page.BaseActivity;

import androidx.navigation.NavController;
import androidx.navigation.fragment.NavHostFragment;

/**
 * User: psn
 * Date: 2021/12/30
 */
public abstract class RouterActivity extends BaseActivity {
        public  NavController navController;
        public void navigation(int id){
                if (navController==null){
                        navController = ((NavHostFragment)getSupportFragmentManager()
                                .findFragmentById(R.id.this_main_fragment)).getNavController();
                }
                navController.navigate(id);
        }
}
